package com.mylove.judas.yaya.mvp.model;

import com.mylove.judas.yaya.common.http.ParamPost;
import com.mylove.judas.yaya.common.rx.RxHttpResponseCompat;
import com.mylove.judas.yaya.common.rx.subscriber.ErrorHandlerSubscriber;
import com.mylove.judas.yaya.entity.ImageEntity;
import com.mylove.judas.yaya.retrofit.ServiceFactory;
import com.mylove.judas.yaya.retrofit.YaYaService;

import java.util.List;

/**
 * Created by Judas on 2018/5/5.
 */

public class MeiTuModel {

    /**
     * 获取美图列表
     * @param params
     * @param subscriber
     */
    public void getImageAll(ParamPost params, ErrorHandlerSubscriber<List<ImageEntity>> subscriber){

        YaYaService yaYaService = ServiceFactory.createService(YaYaService.base_api, YaYaService.class);

        yaYaService.getImageAll(params.getParams())
                .compose(RxHttpResponseCompat.<List<ImageEntity>>compatResult())
                .subscribe(subscriber);

    }

}
